home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / hacklist / 94-04.Z / 94-04 / 000009_rcq@mailserv-D.ftp.com_Sat Apr 9 07:28:42 1994.msg < prev    next >
Internet Message Format  |  1994-04-30  |  2KB

  1. Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  2.           id AB01300; Sat, 9 Apr 1994 11:29:38 -0400
  3. Received: from ftp.com by ftp.com  ; Sat, 9 Apr 1994 11:29:37 -0400
  4. Received: from mailserv-D.ftp.com by ftp.com  ; Sat, 9 Apr 1994 11:29:37 -0400
  5. Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
  6.     id AA19993; Sat, 9 Apr 94 11:28:42 EDT
  7. Date: Sat, 9 Apr 94 11:28:42 EDT
  8. Message-Id: <9404091528.AA19993@mailserv-D.ftp.com>
  9. To: bryan@alex.com
  10. Subject: Re: Closing and reusing sockets
  11. From: rcq@ftp.com  (Bob Quinn)
  12. Reply-To: rcq@ftp.com
  13. Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  14. Sender: rcq@mailserv-D.ftp.com
  15. Repository: mailserv-D.ftp.com, [message accepted at Sat Apr  9 11:28:18 1994]
  16. Originating-Client: hurricane.ftp.com
  17. Content-Length: 1155
  18.  
  19. >  Aha!  I was working on the assumption that EADDRINUSE referred to the
  20. >  *local* address, not the remote address.  The spec doesn't specify --
  21. >  is there any other explicit reference?  I see that Stevens "Unix Network 
  22. >  Programming" does use it as you describe in the rcmd example, page 570.
  23.  
  24. A socket is identified by what Stevens calls the 5-tuple:
  25.    - Protocol
  26.    - Local IP address
  27.    - Local Port Number
  28.    - Remote IP address
  29.    - Remote Port Number
  30.  
  31. You get a WSAEADDRINUSE iff *all 5* elements match between two sockets.
  32.  
  33. The reason doing a bind() on a client is not recommended is because
  34. commonly the one thing that differs in subsequent connections
  35. between a client and *the same* server is the local port number on
  36. a client socket.  Servers *must* bind() to the same port number each
  37. time, because the port number identifies their service.  Clients
  38. typically need not bind() to a port, since an arbitrary port number
  39. is typically acceptable.  RSH and LPR are two of the few exceptions.
  40.   
  41. Regards,
  42. --
  43.  Bob Quinn                                             rcq@ftp.com
  44.  FTP Software, Inc.                                No. Andover, MA